Update version to 2.2.13 across project files#512
Conversation
- Incremented PraisonAI version from 2.2.12 to 2.2.13 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency. - Ensured minimal changes to existing code while maintaining versioning accuracy across the project.
|
Caution Review failedThe pull request is closed. WalkthroughThis update increments the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant PraisonAI CLI
participant Env
participant AutoGen
User->>PraisonAI CLI: Initialize PraisonAI
PraisonAI CLI->>Env: Get OPENAI_API_KEY
PraisonAI CLI->>PraisonAI CLI: Build config_list with api_key, openai_api_key, api_type
PraisonAI CLI->>AutoGen: Provide config_list for compatibility
Possibly related PRs
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for praisonai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Hello @MervinPraison, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
Hello team, Gemini here with a summary of this pull request. This PR primarily focuses on updating the project version to 2.2.13 across various configuration files, Dockerfiles, and documentation snippets to ensure consistency. Additionally, it includes a functional change to improve AutoGen compatibility in the CLI and refines the test suite's handling of API key authentication errors.
Highlights
- Version Update: The project version has been incremented from
2.2.12to2.2.13in the mainpyproject.tomlfile and theuv.lockdependency lock file. - Dockerfile & Documentation Sync: The
praisonaipackage version specified in all Dockerfiles (docker/Dockerfile,docker/Dockerfile.chat,docker/Dockerfile.dev,docker/Dockerfile.ui) and various documentation code snippets (docs/api/praisonai/deploy.html,docs/developers/local-development.mdx,docs/ui/chat.mdx,docs/ui/code.mdx,praisonai/deploy.py) has been updated to2.2.13. - AutoGen Compatibility: Added
openai_api_keyandapi_type: 'openai'fields to theconfig_listinpraisonai/cli.pyto improve compatibility with the AutoGen framework's expected configuration format. - Improved Test Skipping Logic: Modified the test suite (
tests/test.py) to more precisely control when tests are skipped due to API authentication issues. Tests will now only skip if no API key is provided or if a known test/fallback key is used, allowing tests to fail correctly for invalid real keys.
Changelog
Click here to see the changelog
- docker/Dockerfile
- Updated
praisonaiversion from2.2.12to2.2.13in thepip installcommand.
- Updated
- docker/Dockerfile.chat
- Updated
praisonaiversion from2.2.12to2.2.13in thepip installcommand.
- Updated
- docker/Dockerfile.dev
- Updated
praisonaiversion from2.2.12to2.2.13in thepip installcommand.
- Updated
- docker/Dockerfile.ui
- Updated
praisonaiversion from2.2.12to2.2.13in thepip installcommand.
- Updated
- docs/api/praisonai/deploy.html
- Updated
praisonaiversion from2.2.12to2.2.13in the embedded Dockerfile code snippet.
- Updated
- docs/developers/local-development.mdx
- Updated
praisonaiversion from2.2.12to2.2.13in the embedded Dockerfile code snippet.
- Updated
- docs/ui/chat.mdx
- Updated
praisonaiversion from2.2.12to2.2.13in the embedded Dockerfile code snippet.
- Updated
- docs/ui/code.mdx
- Updated
praisonaiversion from2.2.12to2.2.13in the embedded Dockerfile code snippet.
- Updated
- praisonai/cli.py
- Added
openai_api_keyandapi_type: 'openai'to theconfig_listfor better AutoGen compatibility.
- Added
- praisonai/deploy.py
- Updated
praisonaiversion from2.2.12to2.2.13in the generated Dockerfile content.
- Updated
- pyproject.toml
- Updated the project version from
2.2.12to2.2.13in both[project]and[tool.poetry]sections.
- Updated the project version from
- tests/test.py
- Refined the logic for skipping API-dependent tests to only skip when no API key is provided or a test/fallback key is detected, ensuring tests fail correctly for invalid real keys.
- uv.lock
- Updated the locked version of
praisonaifrom2.2.12to2.2.13.
- Updated the locked version of
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Version bumps abound,
Across files, the number's found,
Tests check the key,
AutoGen now agrees,
Code consistency is crowned.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request primarily updates the PraisonAI version to 2.2.13 across various project files, which has been done consistently. Additionally, it introduces compatibility changes for AutoGen in praisonai/cli.py and significantly improves the test skipping logic in tests/test.py related to API key handling.
The changes in praisonai/cli.py are clear and well-commented. The updates to the test skipping logic in tests/test.py are a good improvement for test reliability, ensuring tests fail appropriately if a supposedly valid API key causes authentication issues. However, this new skip logic is duplicated across multiple test methods, which could be refactored for better maintainability.
Summary of Findings
- Code Duplication in Test Skip Logic: The logic for determining whether to skip a test due to API key issues is duplicated across multiple test methods in
tests/test.py. This should be refactored into a helper method to improve maintainability. - Handling of
NoneAPI Key inpraisonai/cli.py(Low Severity - Not Commented): Inpraisonai/cli.py, ifOPENAI_API_KEYis not set,api_key(and subsequentlyopenai_api_key) will beNone. While this is often standard, it's worth ensuring that downstream consumers like AutoGen correctly handle aNonevalue for API keys if one is expected. This is a low-severity observation and was not added as a direct comment due to review settings. - Test Skip Message Verbosity in Command-Line Tests (Low Severity - Not Commented): In
tests/test.py(Diff 6,test_praisonai_commandandtest_praisonai_init_command), the skip messagef"Skipping due to no valid API key provided"does not include the original error or result string. Including this could make debugging easier. This is a low-severity observation and was not added as a direct comment due to review settings.
Merge Readiness
The pull request effectively updates the project version and improves test reliability. However, there's a medium-severity issue regarding duplicated code in tests/test.py that should be addressed to enhance maintainability. I recommend refactoring the test skip logic before merging. As an AI, I am not authorized to approve pull requests; please ensure further review and approval by project maintainers.
| # Only skip if no API key provided or using test/fallback key | ||
| api_key = os.environ.get('OPENAI_API_KEY', '') | ||
| if (not api_key or | ||
| api_key.startswith('sk-test-') or | ||
| api_key == 'nokey' or | ||
| 'fallback' in api_key): | ||
| self.skipTest(f"Skipping due to no valid API key provided: {e}") | ||
| else: | ||
| # Real API key provided - test should fail, not skip | ||
| raise |
There was a problem hiding this comment.
The logic for skipping tests based on the API key status (lines 22-30) is a great improvement for test reliability. However, this exact block of code is repeated in several test methods within this file (e.g., test_main_with_autogen_framework, test_main_with_custom_framework, test_main_with_internet_search_tool, test_main_with_built_in_tool, and similar logic in TestExamples and TestCommandLine).
Could we refactor this duplicated logic into a helper method within the test classes (or a standalone utility function)? This would improve maintainability, as any future changes to this skip logic would only need to be made in one place.
For example, you could introduce a helper method like _handle_api_exception_skip(self, e):
# In TestMainFunctionality class (and similar for other classes)
def _handle_api_exception_skip(self, e: Exception):
"""Checks if the test should be skipped due to API key status and the nature of the exception."""
api_key = os.environ.get('OPENAI_API_KEY', '')
is_fallback_or_missing_key = (
not api_key or
api_key.startswith('sk-test-') or
api_key == 'nokey' or
'fallback' in api_key
)
if is_fallback_or_missing_key:
# Current logic skips for any exception if key is fallback/missing.
# You might want to add checks for specific auth-related error strings from 'e' here
# if you want to be more precise about *why* it's skipping with a fallback key.
self.skipTest(f"Skipping due to no valid API key provided or fallback key in use: {e}")
return True # Indicates test was skipped
return False # Indicates test should not be skipped, and exception should be raised
# Then, in your test methods:
try:
# ... test code ...
except Exception as e:
if self._handle_api_exception_skip(e):
return # Test was skipped
# Real API key provided or not an API-related skip - test should fail
raiseThis would make the test methods cleaner and the skip logic centralized. A similar helper could be adapted for the command-line tests that check result strings instead of exceptions.
except Exception as e:
if self._handle_api_exception_skip(e):
return # Test was skipped by the helper
# Real API key provided - test should fail, not skip
raiseUpdate version to 2.2.13 across project files
pyproject.toml,uv.lock, and all relevant Dockerfiles for consistency.Summary by CodeRabbit